To reduce flicker add a WM_ERASEBKGND handler that just returns TRUE (indicating the msg was processed).

You are getting flicker because you are trying to do a lot of drawing, GDI creation, etc within the paint handler (rather than using a form of double buffering).

Normally a WM_PAINT handler consists of a BeginPaint, a BitBlt and an EndPaint.
It should not contain any complex drawing, this should be done in response to otehr messages (WM_CREATE, WN_INITDLG or user action / input).
These events should call the drawing code that updates a back buffer (memory DC) with the required changes and then generates a WM_PAINT msg.

The WM_PAINT should be generated with a InvalidateRect using the smallest possible RECT (to ensure the fastest BitBlt) and UpdateWindow call (to bypass the OS msg queue where WM_PAINT has the lowest priority and will be ignored in favor of other messages)


>>RedrawWindow(hwnd, NULL, NULL, RDW_NOERASE | RDW_UPDATENOW)

You know this creates a WM_PAINT msg? It should not be in your WM_PAINT handler as it has the potential to create an infinte loop.

As WM_PAINT msgs are processed (concatinated) within the msg queue you are probably not yet experiencing the full impact of this code/bug.

It also creates a WM_ERASEBKGRN message, which it then tries to supress. Not sure what that will do...


>>Why are you using Worst Interface 32 Awful Productiveness Interface instead of a GUI Framework, such as Qt?

Good to see you don't let your personal prejudices get in the way of you giving (useless) advice!

Your post contributed NOTHING to this topic and appears that it was only posted to inflate your own ego by denegrating / mocking the choices made by others.

In otherwords if you have nothing constructive to contribute to this topic, GTFO!